package com.ctgu.tengyun.domain;

import com.ctgu.tengyun.exception.ConvertException;

/**
 * Created by liaoweizhi on 2019/8/20.
 */
public enum RepairType implements HasDefaultInterface<RepairType> {

    unknown(-1),
    day(1),        //日检修
    week(2),       //周检修
    month(3),      //月检修
    ;

    private Integer value;

    RepairType(Integer value) {
        this.value = value;
    }

    @Override
    public RepairType getDefault() {
        return unknown;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static RepairType valueOf(Integer value) {
        for (RepairType item : RepairType.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }

        throw new ConvertException("unknown RepairType. status:" + value);
    }
}
